package Test.ThirdOne;

import java.util.GregorianCalendar;

/**
 * Student
 * 继承 Person
 */
public class Student extends Person {
    private int sID;
    private int classNo;


    /**
     * 带参数构造器
     */
    public Student(String name,char sex,int age,int sID,int classNo){
        super(name,sex,age);
        this.sID=sID;
        this.classNo=classNo;
    }

    /**
     * 设置Student成员变量
     * @param name      姓名
     * @param sex       性别
     * @param age       年龄
     * @param sID       学号
     * @param classNo   班级
     */
    public void setData(String name,char sex,int age,int sID,int classNo){
        super.setData(name,sex,age);
        this.sID=sID;
        this.classNo=classNo;
    }

    /**
     * 获取Person数据
     * @return toString()
     */
    @Override
    public String getData(){
        return this.toString();
    }

    @Override
    public String toString(){
        return super.getData()+" 学号："+sID+" 班级号："+classNo;
    }
    public static void main(String[] args) {
        Student student=new Student("毛建国",'男',19,12,03);
        System.out.println(student.toString());
    }

}
